import Taro, {Component} from '@tarojs/taro'
import {View,Image,Text} from '@tarojs/components'
import AddCut from '../addcut/addcut'
import './foodlist.scss'
export default class FoodList extends Component {
    constructor () {
        super(...arguments);
        this.state = {
        }
    }
    render() {
        let {selectCata,currentList} = this.props;
        return (
            <View className='foodList'>
                <View className='foodList-title'>{selectCata ?selectCata.name:""}</View>
                <View className='foodList-forList'>
                    {
                        currentList.map((item,index)=>{
                            return (<View key={item.id} className='foodList-item'>
                                <Image className='foodList-item-img' src={item.img == 2 ? require('../../assets/img/2.jpg'):require('../../assets/img/1.jpg')}></Image>
                                <View className='foodList-item-info'>
                                    <View className='title'>{item.title}</View>
                                    <View className='sale'>月售{item.sale}</View>
                                    <View className='price'>¥{item.price}</View>
                                    <AddCut food={item}></AddCut>
                                </View>
                            </View>)
                        })
                    }
                </View>
            </View>
        )
    }
}
